package cn.edu.hbpu.controller.v1;

import cn.edu.hbpu.common.R;
import cn.edu.hbpu.entity.FirstCategory;
import cn.edu.hbpu.service.FirstCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lcy
 * @date 2022/8/24 8:49
 * @description
 */
@Slf4j
@RestController
@RequestMapping("/firstCategory")
public class CategoryController {

    @Autowired
    private FirstCategoryService firstCategoryService;

    /**
     * 获取一级分类列表
     * @return
     */
    @GetMapping("/list")
    public R<List<FirstCategory>> getFirstCategoryList() {
        return firstCategoryService.getFirstCategoryList();
    }
}
